// var clock = new Vue({
//     el: '#clock',
//     data: {
//         time: '',
//         date: ''
//     }
// });

var week = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];

var chun=[
  ["时时携步月", "处处把寻春"]
]

var qiu = [
  ["平分秋色一轮满", "长伴云衢千里明"],
  ["月翳翳以隐云", "星胧胧以投光"],
  ["寄身流波", "随风靡倾"],
  ["局景薄西隅", "升月照东垂"],
  ["团团珠晖转", "照照汉阴移"],
  ["兴逸烟霄上", "神闲宇宙中"],
  ["霜天林木燥", "秋气风云高"],
  ["苍茫望落景", "羁旅对穷秋"],
  ["一夜秋声傍海多", "五更寒色早来过"],
  ["六街鼓歇行人绝", "九衢茫茫室有月"],
  ["清切兼秋远", "威仪对月闲"],
  ["晚蝶飘零惊宿雨", "暮鸦淩乱报秋寒"],
  ["雨滋苔藓侵阶绿", "秋飒梧桐覆井黄"],
  ["一撮秋烟堤上白", "半轮残日岭头红"],
  ["十点五点残萤", "千声万声秋雨"],
  ["自古逢秋悲寂寥", "我言秋日胜春朝"],
  ["山明水净夜来霜", "数树深红出浅黄"],
  ["霜落荆门江树空", "布帆无恙挂秋风"],
  ["长川泻落月", "洲渚晓寒凝"],
  ["重门启曙关", "一叶报秋还"],
  ["道边白鹤来华表", "陌上苍麟卧古丘"],
  ["步蟾倚杖看牛斗", "银汉遥应接凤城"],
  ["川光初媚日", "山色正矜秋"],
];

function zeroPadding(num, digit) {
  var zero = "";
  for (var i = 0; i < digit; i++) {
    zero += "0";
  }
  return (zero + num).slice(-digit);
}

function updateClock() {
  var cd = new Date();
  time1 =
    zeroPadding(cd.getHours(), 2) +
    ":" +
    zeroPadding(cd.getMinutes(), 2) +
    ":" +
    zeroPadding(cd.getSeconds(), 2);
  date1 =
    zeroPadding(cd.getFullYear(), 4) +
    "-" +
    zeroPadding(cd.getMonth() + 1, 2) +
    "-" +
    zeroPadding(cd.getDate(), 2) +
    " " +
    week[cd.getDay()];

  var tags = ["time1", "date1"],
    corr = [time1, date1];
  for (var i = 0; i < tags.length; i++) {
    document.getElementById(tags[i]).firstChild.nodeValue = corr[i];
  }
}

function setShiju() {
  var shu = qiu.length;
  selectShiju = Math.random() * shu;
  var select = parseInt(selectShiju);
  var t1 = qiu[select][0];
  var t2 = qiu[select][1];
  document.getElementById("txt1").firstChild.nodeValue = t1;
  document.getElementById("txt2").firstChild.nodeValue = t2;
}

function initClock() {
  setShiju();
  updateClock();
  window.setInterval("updateClock()", 1);
}
